MdbCursor

Resource class for MDB_cursor* handles.

@note Instances of this class are movable, but not copyable. @see http://symas.com/mdb/doc/group__internal.html#structMDB__cursor

Constructors

this
this(MDB_cursor* handle)

Constructor. @param handle a valid MDB_cursor* handle

Destructor

~this
~this()

Destructor.

Members

Functions

close
void close()

Closes this cursor. @note this method is idempotent @post handle() == null

dbi
MDB_dbi dbi()

Returns the cursor's database handle.

find
bool find(K key, MDB_cursor_op op)

Positions this cursor at the given key.

get
bool get(MDB_val* key, MDB_cursor_op op)

Retrieves a key from the database.

get
bool get(MdbVal key, MDB_cursor_op op)

Retrieves a key from the database.

get
bool get(MdbVal key, MdbVal val, MDB_cursor_op op)

Retrieves a key/value pair from the database.

get
bool get(MDB_val* key, MDB_val* val, MDB_cursor_op op)

Retrieves a key/value pair from the database.

get
bool get(string key, string val, MDB_cursor_op op)

Retrieves a key/value pair from the database.

handle
MDB_cursor* handle()

Returns the underlying MDB_cursor* handle.

renew
void renew(MDB_txn* txn)

Renews this cursor.

txn
MDB_txn* txn()

Returns the cursor's transaction handle.

Static functions

open
MdbCursor open(MDB_txn* txn, MDB_dbi dbi)

Creates an LMDB MdbCursor. @param txn the transaction handle @param dbi the database handle @throws lmdb_oo.MbdError on failure

Static variables

default_flags
uint default_flags;

< Default cursor flags for ops

Variables

_handle
MDB_cursor* _handle;

< Opace handle from lmdb library

Meta